#include<iostream>
using namespace std;
const int N = 70;
int main()
{
	unsigned long long ans = 0;
	for (unsigned long long i = 0; i < 64; i++) {
		unsigned long long x;
		cin >> x;
		ans += x << i;
	}
	cout << ans << endl;	
	return 0;
}